﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../include/top.jsp"%>
<%@ include file="../include/errorArea.jsp" %>
<script type="text/javascript">
   	function clickSS(){
		document.getElementById("Image8").click(); 
		$("#Image8").click();
	}
   	
   	$(document).ready(function(){
		
		var tablename=document.getElementById("listTable");
		var li=tablename.getElementsByTagName("tr");
		for (var i=1;i<=li.length;i++){
		if (i%2==0){
		li[i].style.backgroundColor="#f6f6f6";
		}else li[i].style.backgroundColor="#FFFFFF";
		}

	});
</script>
<%-- <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#96b0d5">
  <tr>
    <td height="25" align="center" valign="middle" background="${baseURL}/images/blue_line02.jpg" bgcolor="#FFFFFF">
	    <table width="98%" border="0" cellspacing="0" cellpadding="0">
	      <tr>
	        <td width="20" align="left" valign="middle">&nbsp;</td>
	        <td align="left" valign="middle">
	        	<img src="${baseURL}/images/bit_01.png" width="16" height="14" border="0" align="absmiddle" />
	        	&nbsp;<a href="#" class="a2_blue" onclick="window.location = 'toAddTopic';">发表主题帖子</a>&nbsp;&nbsp;&nbsp;&nbsp;
			</td>
	      </tr>
	    </table>
    </td>
  </tr>
</table> --%>
<div class='adduser'>
	<div class='adduser-left'><div class='adduser-icon'></div><span>运营商沟通</span></div>
</div>


  <form action="${ctx}/forumO2C/listTopic" method="post" name="searchForm" id="searchForm">
    <input type="hidden" name="p" value="1" />
<div class='querycondition'>
	<div class='condtiontitle'><div class='searchcondition'></div>搜索条件：</div>
	<div class='condtion'>
		标题：<input name="title" type="text"  id="title" value="${formdata.title}" size="20"/>&nbsp;&nbsp;
        <input name="image" style="display:none" type="image" id="Image8" onmouseover="MM_swapImage('Image8','','${baseURL}/images/button_ss_a.jpg',1)" onmouseout="MM_swapImgRestore()" src="${baseURL}/images/button_ss.jpg"/>
	    <%-- <img src="${baseURL}/images/button_qk.jpg" name="clearButton" id="clearButton" style="cursor:pointer" onclick="clearInput()" onmouseover="MM_swapImage('clearButton','','${baseURL}/images/button_qk_a.jpg',1)" onmouseout="MM_swapImgRestore()"/>  --%>
		
		<input type='button' value='搜索'  class='button cyan medium' onclick="clickSS();"/>&nbsp;&nbsp;
		<input type='button' value='清空' class='button cyan medium' onclick="clearInput()"/>&nbsp;&nbsp;
	<input type='button' style="float:right" value='发表帖子' class='button cyan medium' onclick="window.location = 'toAddTopic'" onfocus="this.blur()" />
	
	</div>
</div>

<%-- <table width="98%" border="0" align="center" cellpadding="0" cellspacing="1">
  <tr>
    <td height="5" colspan="2"></td>
  </tr>

    <tr>
      <td height="20" align="left" valign="middle">
      <img src="${baseURL}/images/009.png" width="16" height="16" align="absmiddle" />
      &nbsp;搜索条件：&nbsp;
      </td>
    </tr>
    <tr>
      <td height="20" align="left" valign="middle">
      	标题：
        <input name="title" type="text"  id="title"
			value="${formdata.title}" size="20"/>
		
    </tr>
    <tr>
      <td height="20" align="center" valign="middle">
      <input name="image" type="image" id="Image8" onmouseover="MM_swapImage('Image8','','${baseURL}/images/button_ss_a.jpg',1)" onmouseout="MM_swapImgRestore()" src="${baseURL}/images/button_ss.jpg"/>
      &nbsp;&nbsp;&nbsp;&nbsp;
      <img src="${baseURL}/images/button_qk.jpg" name="clearButton" id="clearButton" style="cursor:pointer" onclick="clearInput()" onmouseover="MM_swapImage('clearButton','','${baseURL}/images/button_qk_a.jpg',1)" onmouseout="MM_swapImgRestore()"/>
      </td>
    </tr>
  <tr>
    <td height="5" colspan="2"></td>
  </tr>
  <tr>
    <td height="1" colspan="2" bgcolor="#A6CAE8"></td>
  </tr>
  <tr>
    <td height="5" colspan="2" class="text_gray2"></td>
  </tr>
</table> --%>
  </form>
<script>
$("#companyId").val("${formdata.companyId}");
function clearInput() {
	document.getElementById("title").value = "";
	$("#companyId").val("");
}

function selectAll(checkAllFlag) {
	var checkArray = document.getElementsByName("chk");
	for (var i = 0; i < checkArray.length; i++) {
		checkArray[i].checked = checkAllFlag;
	}
}
</script>

<c:if test="${empty obj.list}">
<div align="center"><b>没有符合条件的记录。</b></div>
</c:if>
<c:if test="${not empty obj.list}">
<div class='userlist-title'>
	<div class='userlist-title-left'><div class='userlist-title-icon'></div><span>主题列表</span></div>
</div>
<div class='userlist'>
<table width="94%" border="0" align="center" cellpadding="0" cellspacing="0" id="listTable">
	<tr class='userlist-tr-title'>
		<td class='userlist-td operation' height="25" width="5%"><input type="checkbox" onclick="selectAll(this.checked);"></td>
		<td class='userlist-td operation' width="25%">标题</td>
		<td class='userlist-td operation' width="12%">From</td>
		<td class='userlist-td operation' width="12%">To</td>
		<td class='userlist-td operation' width="10%">创建时间</td>
		<td class='userlist-td operation' width="5%">查看</td>
		<td class='userlist-td operation' width="10%">最后回复时间</td>
		<td class='userlist-td operation' width="5%">回复数</td>
		<td class='userlist-td operation'>操作</td>
	</tr>
	<c:forEach var="oneRow" items="${obj.list}">
		<tr align="center">
			<td class='userlist-td'><c:if test="${oneRow.fromId==fromId}"><input name="chk" type="checkbox" id="chk" value="${oneRow.topicId}" /></c:if></td>
			<td class='userlist-td' style="text-align:left;"><a href="viewTopic?topicId=${oneRow.topicId}">${oneRow.topicTitle}</a></td>
			<td class='userlist-td' style="text-align:left;">${oneRow.fromName}</td>
			<td class='userlist-td' style="text-align:left;">${oneRow.toName}</td>
			<td class='userlist-td'><fmt:formatDate value="${oneRow.addTime}" pattern="yyyy/MM/dd HH:mm:ss"/></td>
			<td class='userlist-td'>${oneRow.click}</td>
			<td class='userlist-td'><fmt:formatDate value="${oneRow.lastPostTime}" pattern="yyyy/MM/dd HH:mm:ss"/>
			</td>
			<td class='userlist-td'>${oneRow.replyNumber}</td>
			<td class='userlist-td'>
			<c:if test="${oneRow.fromId==fromId}">
				<a href="toEditTopic?id=${oneRow.topicId}">[编辑]</a>
				<a href="#" onclick="delById('${ctx}',${oneRow.topicId})">[删除]</a></c:if>
			</td>
		</tr>
	</c:forEach>
  
</table>
<table>
<tr>
    <td colspan="1">
    	<input name="button" type="button" onclick="delByIds('${ctx}');" value="批量删除"  class='button cyan medium'></td>
  </tr>
  <tr>
    <td height="25" colspan="9"><%@ include file="../include/listpage.jsp"%>
    </td>
  </tr>
</table>
</div>
<script src="${ctx}/js/listO2CTopic.js"></script>
</c:if>

<%@ include file="../include/bottom.jsp"%>